This invention relates to the field of data communications. More particularly, a method and apparatus are provided for improving the performance of protocol processing by caching data required for the processing.
Data communications are typically formatted according to a hierarchy of communication protocols (e.g., as specified by ISO-OSI and/or other standards) in order to ensure their correct routing and handling. In accordance with those protocols, various communication devices such as switches, routers and hosts (e.g., computer systems) must appropriately process the communications at their source, destination and in between.
For example, a packet, frame, cell or other communication element received at a device from a network or other communication link is processed (e.g., by a protocol processor) to parse or remove a protocol header, retrieve a payload (i.e., data) or relevant protocol information, etc. Conversely, data to be transmitted by the device over the network or communication link must be supplemented with appropriate headers or other packaging.
Depending on the content of a particular protocol header, a packet may be handled in different manners (e.g., via a “fast path” or “slow path”). For example, a TCP (Transport Control Protocol) segment or packet received out of order in a receive flow, or with multiple options set, may be assigned to a slow path of processing, while a TCP segment received in order may be processed through a fast path. Communications handled via the slow path necessarily require more processing than fast path communications, but slow path processing offers the flexibility of handling evolving protocols.
Further, protocol processing typically involves the handling of both inbound (i.e., receive) and outbound (i.e., transmit) traffic. For example, a protocol processor configured for handling TCP communications with a remote entity will handle both inbound and outbound flows, and the status of one flow will affect how the other is processed. Thus, a TCP header to be placed on data in an outbound flow to a particular entity may need to reflect the status of a corresponding inbound flow from that entity (e.g., to acknowledge receipt of one or more TCP segments).
A control memory is typically updated in association with protocol processing operations. Illustratively, the control memory will retain protocol processing data needed to generate a header for an outbound flow. However, due to the speed of data communications, the unpredictable nature of data traffic, the need to store statuses of inbound and outbound flows, and the possibility of traffic being processed out of order, the control memory may be updated in an irregular manner.
As a result, the status information in the control memory needed for generation of a new protocol header is unlikely to be stored contiguously. Multiple accesses and read operations are therefore required to retrieve the necessary information. For example, in TCP protocol processing, several TCP data fields must be retrieved to generate a new protocol header. The more time needed to retrieve the protocol processing data, the longer it will take to generate the header and the lower the throughput of the transmit process. The back pressure or processing delay caused by the time spent generating a header will affect the protocol processor and, eventually, a host (e.g., a server).